/*
*  LLSerialization.h
*  
*
*  Created by Alexander Trutchenko on 11/02/12.
*  Copyright 2012 Free Team. All rights reserved.
*
*/

#ifndef __LL_Serialization_h__
#define __LL_Serialization_h__

#include "stdlib.h"

#include <string>

namespace lidlib {

////////////////////////////////////////////////////////
//
/** LLArchive
*  
*/
////////////////////////////////////////////////////////

class LLArchive
{
protected:
	bool _readMode;

public:
	LLArchive(bool readMode): _readMode(readMode) {;} 
	virtual ~LLArchive() {;}

public:
// Main interface
	inline bool readMode() const { return _readMode; }

public:
	virtual void operator &(unsigned char& data) = 0;
	virtual void operator &(char& data) = 0;
	virtual void operator &(unsigned long& data) = 0;
	virtual void operator &(long& data) = 0;
	virtual void operator &(unsigned int& data) = 0;
	virtual void operator &(int& data) = 0;
	virtual void operator &(float& data) = 0;
	virtual void operator &(double& data) = 0;
};

////////////////////////////////////////////////////////
//
/** LLSerializable
*  
*/
////////////////////////////////////////////////////////

class LLSerializable
{
public:
	virtual void serialize(LLArchive& ar, const unsigned int version) = 0;
};


} // namespace lidlib

#endif //__LL_Serialization_h__
